package insight.google.game.era.data;

import java.util.Date;

import org.directwebremoting.annotations.DataTransferObject;
import org.directwebremoting.annotations.RemoteProperty;

@DataTransferObject
public class UserGameHistory {

	@RemoteProperty
	private String roomName;

	@RemoteProperty
	private Date startTime;

	@RemoteProperty
	private Date endTime;

	@RemoteProperty
	private int gameStatus;

	@RemoteProperty
	private String roleName;

	@RemoteProperty
	private String characterName;

	@RemoteProperty
	private int userResultStatus;

	public UserGameHistory(GameHistoryDetail userGameHistory) {

		if (userGameHistory != null) {
			
			this.roleName = userGameHistory.getRoleName();
			this.characterName = userGameHistory.getCharacterName();
			this.userResultStatus = userGameHistory.getUserStatus();
			if(userGameHistory.getGameHistory() != null){
				GameHistory gameHistory = userGameHistory.getGameHistory(); 
				this.roomName = gameHistory.getRoomName();
				this.startTime = gameHistory.getStartTime();
				this.endTime = gameHistory.getEndTime();
				this.gameStatus = gameHistory.getStatus();
			}
		}
	}

	public String getRoomName() {
		return roomName;
	}

	public void setRoomName(String roomName) {
		this.roomName = roomName;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public int getGameStatus() {
		return gameStatus;
	}

	public void setGameStatus(int gameStatus) {
		this.gameStatus = gameStatus;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getCharacterName() {
		return characterName;
	}

	public void setCharacterName(String characterName) {
		this.characterName = characterName;
	}

	public int getUserResultStatus() {
		return userResultStatus;
	}

	public void setUserResultStatus(int userResultStatus) {
		this.userResultStatus = userResultStatus;
	}

}
